package com.itheima.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/day214")
public class HappyDay extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1,设置网页编码模式
        resp.setContentType("text/html; charset=UTF-8");
        //获得响应打印流
        PrintWriter writer = resp.getWriter();
        //向网页打印
        writer.println("<img src='https://img1.baidu.com/it/u=313503702,2058655608&fm=253&fmt=auto&app=138&f=JPEG?w=890&h=500'/>");
    }
}
